
const models = {
  'purchase.order': {
    extend: BaseClass => {
      class cls extends BaseClass {
      }

      cls.button_approve = async (id, fields={}, force=false, kwargs={}) => {
        return cls.call_as_write_read({
          method: 'button_approve',
          args: [ id, force ],
          kwargs,
        }, fields );
      }

      cls.button_draft = async (id, fields={}, kwargs={}) => {
        return cls.call_as_write_read({
          method: 'button_draft',
          args: [ id ],
          kwargs,
        }, fields );
      }

      cls.button_confirm = async (id, fields={}, kwargs={}) => {
        return cls.call_as_write_read({
          method: 'button_confirm',
          args: [ id ],
          kwargs,
        }, fields );
      }

      cls.button_cancel = async (id, fields={}, kwargs={}) => {
        return cls.call_as_write_read({
          method: 'button_cancel',
          args: [ id ],
          kwargs,
        }, fields );
      }

      cls.button_unlock = async (id, fields={}, kwargs={}) => {
        return cls.call_as_write_read({
          method: 'button_unlock',
          args: [ id ],
          kwargs,
        }, fields );
      }

      cls.button_done = async (id, fields={}, kwargs={}) => {
        return cls.call_as_write_read({
          method: 'button_done',
          args: [ id ],
          kwargs,
        }, fields );
      }

      cls.action_set_date_planned = async (id, fields={}, kwargs={}) => {
        return cls.call_as_write_read({
          method: 'action_set_date_planned',
          args: [ id ],
          kwargs,
        }, fields );
      }

      return cls;
    },

  },

//    'purchase.order.line': {},
};


export default {
  name: 'purchase',
  depends: [ 'account' ],
  models,
};




